// 区间修改，单点查询
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10, M = N;
ll a[N], bit[N];
int n, m;
int lowbit(int x) { return x & -x; }

void add(int x, ll k) {
  for (int i = x; i <= n; i += lowbit(i)) bit[i] += k;
}
ll query(int x) {
  ll sum = a[x];
  for (int i = x; i; i -= lowbit(i)) sum += bit[i];
  return sum;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  while (m--) {
    char op;
    cin >> op;
    if (op == 'C') {
      ll l, r, d;
      cin >> l >> r >> d;
      add(l, d), add(r + 1, -d);
    } else if (op == 'Q') {
      ll x;
      cin >> x;
      cout << query(x) << '\n';
    } else {
      cout << "Unreachable code\n";
    }
  }
}
